package com.payment.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConstantsUtil {

	private static String CONSTANTS_FILE = "payconstants.properties";
	private static Properties props = new Properties();
	static {
		InputStream ips = ConstantsUtil.class.getClassLoader()
				.getResourceAsStream(CONSTANTS_FILE);
		try {
			props.load(ips);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getProperty(String key) {
		String message=props.getProperty(key);
		if(message != null && !"".equals(message)){
            return message;
		}
		return key;
	}
}